package com.school.manager.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.school.manager.domaim.UserTask;
import com.school.manager.entity.po.UserTaskPo;
import com.school.manager.entity.vo.UserTaskVo;
import com.school.manager.mapper.UserTaskMapper;
import com.school.manager.service.IUserTaskService;
import com.school.manager.utils.PageUtil;

import lombok.extern.slf4j.Slf4j;

/**
 * description：用户任务业务实现类
 * date：2021/10/133:18 下午
 */

@Service
@Slf4j
public class UserTaskServiceImpl extends ServiceImpl<UserTaskMapper, UserTask> implements IUserTaskService {
	
	@Autowired
    private UserTaskMapper userTaskMapper;
	
	@Override
	public Page<UserTaskVo> page(UserTaskPo userTaskPo) {
		QueryWrapper<UserTask> queryWrapper = PageUtil.buildQueryWrapper(userTaskPo, UserTask.class);
        Page<UserTask> page = new Page<>(userTaskPo.getCurrent(), userTaskPo.getSize());
        userTaskMapper.selectPage(page, queryWrapper);
        return PageUtil.buildPage(page, UserTaskVo.class);
	}

	

}
